package mapping

import (
	"maya-service/model"
	"maya-service/model/entity"
)

// OrdersEntityToDto entity data transfer
func OrdersEntityToDto(orders []*entity.Order) []*model.OrderInfo {
	out := make([]*model.OrderInfo, 0, len(orders))
	for _, c := range orders {
		out = append(out, OrderEntityToDto(c))
	}
	return out
}

// OrderEntityToDto entity data transfer
func OrderEntityToDto(e *entity.Order) *model.OrderInfo {
	return &model.OrderInfo{

		Id: e.Id,

		OrderId: e.OrderId,

		CustomerId: e.CustomerId,

		OrderDate: e.OrderDate,

		OrderStatus: e.OrderStatus,

		TotalAmount: e.TotalAmount,

		PaymentMethod: e.PaymentMethod,

		ShippingAddress: e.ShippingAddress,

		Remarks: e.Remarks,

		OrderContext: e.OrderContext,

		ExtraData: e.ExtraData,

		CreatedAt: e.CreatedAt,

		UpdatedAt: e.UpdatedAt,
	}
}
